package com.weishu.controller;


import com.weishu.domain.TbRoomInfo;
import com.weishu.mapper.TbRoomInfoMapper;
import com.weishu.service.ITbRoomInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author liyan
 * @since 2021-07-26
 */
@RestController
@RequestMapping("/tbRoomInfo")
public class TbRoomInfoController {

    @Autowired
    private ITbRoomInfoService tbRoomInfoService;

    @RequestMapping("add")
    public boolean add(@RequestBody TbRoomInfo roomInfo){
        System.out.println(roomInfo);
        boolean save = tbRoomInfoService.adds(roomInfo);
        return save;
    }
    //查询出房源
    @RequestMapping("list")
    public List<TbRoomInfo> lists(){
        List<TbRoomInfo> list = tbRoomInfoService.select();
        return list;
    }
}

